#include"process.h"
#include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<unistd.h>
typedef void(* flush_t)(double ,double);

#define speed 50
void download(flush_t f)
{
    double count=0;
    while(count<100)
    {
        double num=(rand()%speed)*0.1;
        count+=num;
        if(count>=100)
        {
            count=100;
        }
        f(count,100);
        usleep(100000);
    }
    printf("\n");
    
    
}
//////
int main()
{
    srand(time(NULL));
    download(flushdown);
    return 0;
}//
//////